package org.graduation.utils;

import org.graduation.model.common.ResponseResult;

public class ResponseResultUtil {
    public static ResponseResult simpleCheck(boolean b) {
        if (b) {
            return ResponseResult.success();
        } else {
            return ResponseResult.failed();
        }
    }

    public static ResponseResult simpleCheckHaveData(boolean b, Object data) {
        if (b) {
            return ResponseResult.success(data);
        } else {
            return ResponseResult.failed();
        }
    }

    public static ResponseResult simpleCheck(boolean b, String failedMsg) {
        if (b) {
            return ResponseResult.success();
        } else {
            return ResponseResult.failed(failedMsg);
        }
    }
}
